/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.demo.service;

import com.demo.exception.RestException;
import com.demo.model.Account;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 *
 * @author student
 */
public interface AccountService extends UserDetailsService {
    public Account put(
            long id, 
            String email, 
            String fname, 
            String lname, 
            String zip, 
            String gender,
            long roleValue) 
            throws RestException;
    
    public Account post(
            String email, 
            String fname, 
            String lname, 
            String zip, 
            String gender,
            long roleValue) 
            throws RestException;
    public Account get(long item) throws RestException;
    public boolean delete(long item) throws RestException;
    public List list() throws RestException;
    
    public Account setAuthentication(String user, String password, Collection<GrantedAuthority> authorities);
    
	//public Account getLoggedInAccount();
    public Account getAccountByLogin(String login);

    public boolean hasOneRole(String role);
    public boolean hasRole(ArrayList<String> roles);
    public void setRole(Account account, String roleName);
    public String getRole();
    
}
